<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/uvlper.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">uvlper.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../dc/d4b/uvlper_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;uv.h&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &quot;<a class="code" href="../../de/d6d/singleton_8hpp.html">designM/singleton.hpp</a>&quot;</span></div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html">   15</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a> : <span class="keyword">public</span> <a class="code hl_class" href="../../de/d44/classwheels_1_1dm_1_1singleton.html">wheels::dm::singleton</a>&lt; looper &gt;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>{</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="keyword">friend</span> <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a> * <a class="code hl_friend" href="../../d1/d0f/classlooper.html#aaf8a9ed2dd9f1f83a9acfa8cd7b6b512">CreateLooper</a>();</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html#aa1ffcd338d3aa3768f67470c02ea2051">   20</a></span>    uv_loop_t        * <a class="code hl_variable" href="../../d1/d0f/classlooper.html#aa1ffcd338d3aa3768f67470c02ea2051">pt_loop</a>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html#a95471c02e42ce2d55d52daea302cf20c">   21</a></span>    std::atomic&lt;bool&gt;         <a class="code hl_variable" href="../../d1/d0f/classlooper.html#a95471c02e42ce2d55d52daea302cf20c">m_is_run</a>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>    <a class="code hl_function" href="../../d1/d0f/classlooper.html#a74e572cbf588a4d3a8112270d3e07a85">looper</a>();</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html#a20dac7178bb2a64a6e3a96d5b589e49b">   24</a></span>    <a class="code hl_function" href="../../d1/d0f/classlooper.html#a20dac7178bb2a64a6e3a96d5b589e49b">looper</a>( <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a>&amp; b ) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html#aedc7fbb668d3b7d756c1c5721254eb5a">   25</a></span>    <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a>&amp; <a class="code hl_function" href="../../d1/d0f/classlooper.html#aedc7fbb668d3b7d756c1c5721254eb5a">operator =</a>( <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a>&amp; b ) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    <span class="keyword">virtual</span> <a class="code hl_function" href="../../d1/d0f/classlooper.html#ab56cfe0ef8476a174ef299d691739032">~looper</a>();</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/d0f/classlooper.html#a2a532f774c4e60fe1052fd75a8429fc9">run</a>( uv_run_mode mode = UV_RUN_DEFAULT );</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/d0f/classlooper.html#a48a88de3272b7f28ed22544e5cf7b1ec">stop</a>();</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d1/d0f/classlooper.html#a0c748ad769d76b1dc291fc7da22071e9">   36</a></span>    uv_loop_t * <a class="code hl_function" href="../../d1/d0f/classlooper.html#a0c748ad769d76b1dc291fc7da22071e9">getLoop</a>(){ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d1/d0f/classlooper.html#aa1ffcd338d3aa3768f67470c02ea2051">pt_loop</a>; }</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>};</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="keyword">extern</span> <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a> * <a class="code hl_function" href="../../dc/d4b/uvlper_8hpp.html#aaf8a9ed2dd9f1f83a9acfa8cd7b6b512">CreateLooper</a>();</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="keyword">extern</span> <a class="code hl_class" href="../../d1/d0f/classlooper.html">looper</a> * <a class="code hl_function" href="../../dc/d4b/uvlper_8hpp.html#a309790d96fad69beef3657811c68fc21">GetLooper</a>();    </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="ttc" id="aclasslooper_html"><div class="ttname"><a href="../../d1/d0f/classlooper.html">looper</a></div><div class="ttdoc">libuv 事件循环控制器。所有的libuv事件循环都应该依赖于这个模块。如果硬件设备是多核的 可以把这个模块设计成多个线程循环的模块。否则应该是一个循环线程</div><div class="ttdef"><b>定义</b> <a href="#l00015">uvlper.hpp:16</a></div></div>
<div class="ttc" id="aclasslooper_html_a0c748ad769d76b1dc291fc7da22071e9"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a0c748ad769d76b1dc291fc7da22071e9">looper::getLoop</a></div><div class="ttdeci">uv_loop_t * getLoop()</div><div class="ttdef"><b>定义</b> <a href="#l00036">uvlper.hpp:36</a></div></div>
<div class="ttc" id="aclasslooper_html_a20dac7178bb2a64a6e3a96d5b589e49b"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a20dac7178bb2a64a6e3a96d5b589e49b">looper::looper</a></div><div class="ttdeci">looper(const looper &amp;b)=delete</div></div>
<div class="ttc" id="aclasslooper_html_a2a532f774c4e60fe1052fd75a8429fc9"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a2a532f774c4e60fe1052fd75a8429fc9">looper::run</a></div><div class="ttdeci">void run(uv_run_mode mode=UV_RUN_DEFAULT)</div><div class="ttdoc">启动循环</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00026">uvlper.cpp:26</a></div></div>
<div class="ttc" id="aclasslooper_html_a48a88de3272b7f28ed22544e5cf7b1ec"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a48a88de3272b7f28ed22544e5cf7b1ec">looper::stop</a></div><div class="ttdeci">void stop()</div><div class="ttdoc">停止运行</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00042">uvlper.cpp:42</a></div></div>
<div class="ttc" id="aclasslooper_html_a74e572cbf588a4d3a8112270d3e07a85"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a74e572cbf588a4d3a8112270d3e07a85">looper::looper</a></div><div class="ttdeci">looper()</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00008">uvlper.cpp:8</a></div></div>
<div class="ttc" id="aclasslooper_html_a95471c02e42ce2d55d52daea302cf20c"><div class="ttname"><a href="../../d1/d0f/classlooper.html#a95471c02e42ce2d55d52daea302cf20c">looper::m_is_run</a></div><div class="ttdeci">std::atomic&lt; bool &gt; m_is_run</div><div class="ttdef"><b>定义</b> <a href="#l00021">uvlper.hpp:21</a></div></div>
<div class="ttc" id="aclasslooper_html_aa1ffcd338d3aa3768f67470c02ea2051"><div class="ttname"><a href="../../d1/d0f/classlooper.html#aa1ffcd338d3aa3768f67470c02ea2051">looper::pt_loop</a></div><div class="ttdeci">uv_loop_t * pt_loop</div><div class="ttdef"><b>定义</b> <a href="#l00020">uvlper.hpp:20</a></div></div>
<div class="ttc" id="aclasslooper_html_aaf8a9ed2dd9f1f83a9acfa8cd7b6b512"><div class="ttname"><a href="../../d1/d0f/classlooper.html#aaf8a9ed2dd9f1f83a9acfa8cd7b6b512">looper::CreateLooper</a></div><div class="ttdeci">friend looper * CreateLooper()</div><div class="ttdoc">事件循环器工厂函数。如果对象存在则会创建失败返回空。否则返回循环器对象</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00049">uvlper.cpp:49</a></div></div>
<div class="ttc" id="aclasslooper_html_ab56cfe0ef8476a174ef299d691739032"><div class="ttname"><a href="../../d1/d0f/classlooper.html#ab56cfe0ef8476a174ef299d691739032">looper::~looper</a></div><div class="ttdeci">virtual ~looper()</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00016">uvlper.cpp:16</a></div></div>
<div class="ttc" id="aclasslooper_html_aedc7fbb668d3b7d756c1c5721254eb5a"><div class="ttname"><a href="../../d1/d0f/classlooper.html#aedc7fbb668d3b7d756c1c5721254eb5a">looper::operator=</a></div><div class="ttdeci">looper &amp; operator=(const looper &amp;b)=delete</div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1singleton_html"><div class="ttname"><a href="../../de/d44/classwheels_1_1dm_1_1singleton.html">wheels::dm::singleton</a></div><div class="ttdef"><b>定义</b> <a href="../../de/d6d/singleton_8hpp_source.html#l00019">singleton.hpp:20</a></div></div>
<div class="ttc" id="asingleton_8hpp_html"><div class="ttname"><a href="../../de/d6d/singleton_8hpp.html">singleton.hpp</a></div></div>
<div class="ttc" id="auvlper_8hpp_html_a309790d96fad69beef3657811c68fc21"><div class="ttname"><a href="../../dc/d4b/uvlper_8hpp.html#a309790d96fad69beef3657811c68fc21">GetLooper</a></div><div class="ttdeci">looper * GetLooper()</div><div class="ttdoc">获取循环器</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00061">uvlper.cpp:61</a></div></div>
<div class="ttc" id="auvlper_8hpp_html_aaf8a9ed2dd9f1f83a9acfa8cd7b6b512"><div class="ttname"><a href="../../dc/d4b/uvlper_8hpp.html#aaf8a9ed2dd9f1f83a9acfa8cd7b6b512">CreateLooper</a></div><div class="ttdeci">looper * CreateLooper()</div><div class="ttdoc">事件循环器工厂函数。如果对象存在则会创建失败返回空。否则返回循环器对象</div><div class="ttdef"><b>定义</b> <a href="../../d1/db2/uvlper_8cpp_source.html#l00049">uvlper.cpp:49</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
